# encoding=utf-8
import sys
import unittest
from appium import webdriver
from Configure import Attribute
class FindElementTest(unittest.TestCase):
    def setUp(self):
        desired_capabilities = {'aut': 'com.shenzhou.tyy_jz:2.3.1'}

        self.driver = webdriver.Remote(
            desired_capabilities=desired_capabilities
        )
        self.driver.implicitly_wait(30)

    def test_find_element_by_id(self):
        #self.driver.start_activity("com.shenzhou.tyy_jz",Attribute.activity_welcome)
        self.driver.get('and-activity://io.selendroid.testapp.HomeScreenActivity')
        self.assertTrue("and-activity://HomeScreenActivity" in self.driver.current_url)
        my_text_field = self.driver.find_element_by_id('my_text_field')
        my_text_field.send_keys('Hello Selendroid')

        self.assertTrue('Hello Selendroid' in my_text_field.text)

    def tearDown(self):
        self.driver.quit()

if __name__ == '__main__':
    unittest.main()